<?php

namespace App\Http\Controllers;

use App\Models\Product;
use App\Models\ProductType;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class ProductTypeController extends Controller
{
    /**
     * 列表
     * @param Request $request
     * @return JsonResponse
     */
    public function index(Request $request): JsonResponse
    {
        $params = $request->all();

        $productType = new ProductType();
        $params['status'] = 'ENABLE';
        $data = $productType->getList($params);

        return response()->json(['status' => 1, 'data' => $data]);
    }
}
